<div class="yui-g">
    <div class="rounded linea">
        <div class="borde_amarillo">
            <h1>
                <?=
                $this->modelo_categorias->get_nombre_categoria_bn_seo($categoria);
                echo $this->modelo_categorias->categoria_nombre;
                $cat = split(" ",$this->modelo_categorias->categoria_nombre);
                ?>
            </h1>
        </div>
    </div>
    <div class="yui-u first">
        <div class="rounded linea">
            <div class="borde" style="background-color:#fff; padding:5px;text-align:center;">
                <div class="pics" id="slideshow" style="text-align : center;"  >
                    <?php // reemplazar este codigo feisimo por un for que leea las imagenese del codigo_*?>
                    <?php
                    if ($this->modelo_ec->product_full_image >='4') {
                        $size = GetImageSize(base_url()."mid/".$this->modelo_ec->product_id.".jpg");
                        $anchura = $size[0];
                        $altura  = $size[1];
                        ?>
                    <img src="<?=base_url();?>mid/<?=$this->modelo_ec->product_id?>.jpg"   alt="<?=$this->modelo_ec->product_name;?>" title="<?=$this->modelo_ec->product_name;?>" width="<?=$anchura?>" height="<?=$altura?>" />
                    <img src="<?=base_url();?>mid/<?=$this->modelo_ec->product_id?>_a.jpg" alt="<?=$this->modelo_ec->product_name;?>" title="<?=$this->modelo_ec->product_name;?>" />
                    <img src="<?=base_url();?>mid/<?=$this->modelo_ec->product_id?>_b.jpg" alt="<?=$this->modelo_ec->product_name;?>" title="<?=$this->modelo_ec->product_name;?>" />
                    <img src="<?=base_url();?>mid/<?=$this->modelo_ec->product_id?>_c.jpg" alt="<?=$this->modelo_ec->product_name;?>" title="<?=$this->modelo_ec->product_name;?>" />
                    <?php }elseif ($this->modelo_ec->product_full_image =='3') {
                        $size = GetImageSize(base_url()."mid/".$this->modelo_ec->product_id.".jpg");
                        $anchura = $size[0];
                        $altura  = $size[1];
                        ?>
                    <img src="<?=base_url();?>mid/<?=$this->modelo_ec->product_id?>.jpg"   alt="<?=$this->modelo_ec->product_name;?>" title="<?=$this->modelo_ec->product_name;?>" />
                    <img src="<?=base_url();?>mid/<?=$this->modelo_ec->product_id?>_a.jpg" alt="<?=$this->modelo_ec->product_name;?>" title="<?=$this->modelo_ec->product_name;?>" />
                    <img src="<?=base_url();?>mid/<?=$this->modelo_ec->product_id?>_b.jpg" alt="<?=$this->modelo_ec->product_name;?>" title="<?=$this->modelo_ec->product_name;?>" />
                    <img src="<?=base_url();?>mid/<?=$this->modelo_ec->product_id?>_b.jpg" alt="<?=$this->modelo_ec->product_name;?>" title="<?=$this->modelo_ec->product_name;?>" />
                    <?php }elseif ($this->modelo_ec->product_full_image =='2') {
                        $size = GetImageSize(base_url()."mid/".$this->modelo_ec->product_id.".jpg");
                        $anchura = $size[0];
                        $altura  = $size[1];
                        ?>
                    <img src="<?=base_url();?>mid/<?=$this->modelo_ec->product_id?>.jpg"   alt="<?=$this->modelo_ec->product_name;?>" title="<?=$this->modelo_ec->product_name;?>" />
                    <img src="<?=base_url();?>mid/<?=$this->modelo_ec->product_id?>_a.jpg" alt="<?=$this->modelo_ec->product_name;?>" title="<?=$this->modelo_ec->product_name;?>" />
                    <img src="<?=base_url();?>mid/<?=$this->modelo_ec->product_id?>.jpg"   alt="<?=$this->modelo_ec->product_name;?>" title="<?=$this->modelo_ec->product_name;?>" />
                    <img src="<?=base_url();?>mid/<?=$this->modelo_ec->product_id?>_a.jpg" alt="<?=$this->modelo_ec->product_name;?>" title="<?=$this->modelo_ec->product_name;?>" />
                    <?php }elseif ($this->modelo_ec->product_full_image =='1') {
                        $size = GetImageSize(base_url()."mid/".$this->modelo_ec->product_id.".jpg");
                        $anchura = $size[0];
                        $altura  = $size[1];
                        ?>
                    <img src="<?=base_url();?>mid/<?=$this->modelo_ec->product_id?>.jpg" alt="<?=$this->modelo_ec->product_name;?>" title="<?=$this->modelo_ec->product_name;?>" width="<?=$anchura?>" height="<?=$altura?>" />
                    <img src="<?=base_url();?>mid/<?=$this->modelo_ec->product_id?>.jpg" alt="<?=$this->modelo_ec->product_name;?>" title="<?=$this->modelo_ec->product_name;?>" width="<?=$anchura?>" height="<?=$altura?>" />
                    <img src="<?=base_url();?>mid/<?=$this->modelo_ec->product_id?>.jpg" alt="<?=$this->modelo_ec->product_name;?>" title="<?=$this->modelo_ec->product_name;?>" width="<?=$anchura?>" height="<?=$altura?>" />
                    <img src="<?=base_url();?>mid/<?=$this->modelo_ec->product_id?>.jpg" alt="<?=$this->modelo_ec->product_name;?>" title="<?=$this->modelo_ec->product_name;?>" width="<?=$anchura?>" height="<?=$altura?>" />

                    <?php }elseif ($this->modelo_ec->product_full_image =='0' || $this->modelo_ec->product_full_image =='' ) {?>
                    El Producto no posee fotos 
                    <?php }?>
                </div>
            </div>
        </div>
    </div>
    <div class="yui-u">
        <div class="rounded linea">
            <div class="borde" style="background-color:#fff; padding:5px">
                <h1><?=$this->modelo_ec->product_name;?></h1>
                <div style="height:5px"></div><!-- separator -->
                <form action="<?=base_url()?>index.php/ec/confirmar_carrito" method="post">
                    <table border="0" width="100%">
                        <tr>
                            <td>Precio: </td>
                            <td>$<?=$this->modelo_ec->product_price?></td>
                        </tr>
                        <tr>
                            <td>Ubicaci&oacute;n</td>
                            <td>Villa Devoto</td>
                        </tr>
                        <tr>
                            <td>Cantidad</td>
                            <td>
                                <input class="input_cantidades" name="quantity" size="4" value="1" />
                            </td>
                        </tr>
                        <tr>
                            <td align="right" colspan="2">
                                <input name="order_code" type="hidden" value="<?=$this->modelo_ec->product_id;?>">
                                <?php if($this->session->userdata('logged_in')):?>
                                <input type="image" tabindex="-1" src="<?=base_url();?>images/comprar.jpg" alt="comprar"/>
                                <?php else:?>
                                <a onclick="showLogin();$('#modal').bind('login',function(){location.reload();});" href="javascript://">
                                    <img src="<?=base_url();?>images/comprar.jpg" alt="comprar">
                                </a>
                                <?php endif;?>
                            </td>
                        </tr>
                    </table>
                </form>
                <div style="height:5px"></div><!-- separator -->
                <div class="rounded linea">
                    <div class="borde" style="background-color:#fff; padding:5px">
                        <?=$this->modelo_ec->product_desc?>
                    </div>
                </div>
                <?php
                if ($cat[0]=='Fuentes'){
                ?>
                <div>
                    <br>
                    <h1>CERTIFICADO DE GARANTIA DE 6 MESES</h1><br>
                    El motor que se entrega con esta fuente posee
                    una garantia de 6 meses<br>
                </div>
                <?php } ?>
            </div>
        </div>
    </div>
</div>
<div style="height:5px"></div> <!-- separator -->
<div class="yui-g">
    <div class="rounded linea">
        <div class="borde_amarillo">
            <h1>Preguntas al Vendedor</h1>
        </div>
    </div>
    <div class="rounded linea">
        <div class="borde_blanco">

            <?php
            $consulta1 = $this->db->query("SELECT * FROM productos_preguntas WHERE id_producto='".$this->modelo_ec->product_id."'");
            if ($consulta1->num_rows() > 0) {
                ?>
            <table border="0" width="100%">
                    <?php foreach ($consulta1->result() as $row1):?>
                        <?php if(isset($row1->id_producto)):?>
                <tr>
                    <td>
                        <table border="0" width="100%">
                            <tr>
                                <td width="70">Pregunta:</td>
                                <td><?=$row1->texto?></td>
                                            <?php $query = $this->db->query("SELECT * FROM productos_respuestas WHERE id_producto='".$row1->id_producto."' AND id_pregunta=".$row1->id_pregunta);
                                            $row2=$query->row();
                                            ?>
                            </tr>
                                        <?php if(isset($row2->texto)):?>
                            <tr>
                                <td width="70">Respuesta:</td>
                                <td><?=$row2->texto;?></td>
                            </tr>
                                        <?php else:?>
                            <tr>
                                <td>
                                                    <?php // si la pregunta es para este vendedor le damos la posibilidad de responder
                                                    if($this->session->userdata('id')==$row1->id_vendedor):?>
                                    <a href="#" onclick="addSiteAnswers(<?=$this->modelo_ec->vendor_id;?>,<?=$this->modelo_ec->product_id;?>,<?=$row1->id_pregunta;?>);">Responder</a>
                                                    <?php endif;?>
                                </td>
                            </tr>
                                        <?php endif;?>
                        </table>

                    </td>
                </tr>
                        <?php endif;?>
                    <?php endforeach;?>
                <tr>
                    <td>
                        <a href="#" onclick="addSiteQuestions(<?=$this->modelo_ec->vendor_id;?>,<?=$this->modelo_ec->product_id;?>);">Preguntar al Vendedor</a>
                    </td>
                </tr>
            </table>
            <!-- fin prueba -->
            <?php
            }else {
                echo "No hay consultas por ahora... Quieres ser el primero en preguntar ?";?>
                <?php if($this->session->userdata('logged_in')):?>
            <a href="#" onclick="addSiteQuestions(<?=$this->modelo_ec->vendor_id;?>,<?=$this->modelo_ec->product_id;?>);">Preguntar al Vendedor</a>
                <?php else:?>
            <a onclick="showLogin();$('#modal').bind('login',function(){location.reload();});" href="javascript://">
                Preguntar al Vendedor
            </a>
                <?php endif;?>

            <?php }
            ?>
        </div>
    </div>
</div>






